package com.producerConsumer;

public class Consumer implements Runnable {

	StackBasket ss = new StackBasket();

	Consumer(StackBasket ss) {
		this.ss = ss;
	}

	/**
	 * show 消费进程.
	 */
	public void run() {
		for (int i = 0; i < 20; i++) {
			Mantou m = ss.pop();
			try {
				Thread.sleep((int) (Math.random() * 1000));
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}

}
